{include file="finance/common" /}
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="" style="margin-top:15px">

    <!-- <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Group.name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select id="c-group_id" data-rule="required" class="form-control" name="row[group_id]" placeholder="请选择{:__('Group.name')}">
                {foreach name="groupdata" item="vo"}
                    <option value="{$key}" {if isset($row)}{in name="key" value="$row.group_id"}selected{/in}{/if}>{$vo}</option>
                {/foreach}
            </select>
        </div>
    </div> -->
    <input id="c-h_id" data-rule="required" class="form-control hidden" step="0.01" name="row[h_id]" type="number" value="{$admin.home_id|htmlentities}">
    <input id="c-u_id" data-rule="required" class="form-control hidden" step="0.01" name="row[u_id]" type="number" value="{$admin.id|htmlentities}">
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Subjects.name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-subjects_id" data-rule="required" min="0" data-source="finance/subjects/index" class="form-control selectpage" name="row[subjects_id]" type="text" value="{if isset($row)}{$row.subjects_id|htmlentities}{/if}" placeholder="请选择{:__('Subjects.name')}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Type.name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-type_id" data-rule="required" min="0" data-source="finance/income/index" class="form-control selectpage" name="row[type_id]" type="text" value="{if isset($row)}{$row.type_id|htmlentities}{/if}" placeholder="请选择{:__('Type.name')}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Datatime')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-datatime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[datatime]" type="text" value="{if isset($row)}{:$row.datatime?datetime($row.datatime):''}{else}{:date('Y-m-d H:i:s')}{/if}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Amount')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-amount" data-rule="required" class="form-control" step="0.01" name="row[amount]" type="number" value="{if isset($row)}{$row.amount|htmlentities}{/if}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Desc')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-desc" data-rule="length(~255, true)" class="form-control " rows="5" name="row[desc]" cols="50" placeholder="请输入{:__('desc')}">{if isset($row)}{$row.desc|htmlentities}{/if}</textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Proofimage')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-proofimage" class="form-control" size="50" name="row[proofimage]" type="textarea" value="{if isset($row)}{$row.proofimage|htmlentities}{/if}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-proofimage" class="btn btn-danger faupload" data-input-id="c-proofimage" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-proofimage"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <!-- <span><button type="button" id="fachoose-proofimage" class="btn btn-primary fachoose" data-input-id="c-proofimage" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span> -->
                </div>
                <span class="msg-box n-right" for="c-proofimage"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-proofimage"></ul>
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
